home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / shmem_swap.z / shmem_swap
Encoding:
Text File  |  2002-10-03  |  9.7 KB  |  104 lines

  1.  
  2. SHMEM_SWAP(3)                                                 SHMEM_SWAP(3)
  3.  
  4.  
  5. NNNNAAAAMMMMEEEE
  6.      sssshhhhmmmmeeeemmmm____ddddoooouuuubbbblllleeee____sssswwwwaaaapppp, sssshhhhmmmmeeeemmmm____ffffllllooooaaaatttt____sssswwwwaaaapppp, sssshhhhmmmmeeeemmmm____iiiinnnntttt____sssswwwwaaaapppp, sssshhhhmmmmeeeemmmm____lllloooonnnngggg____sssswwwwaaaapppp,
  7.      sssshhhhmmmmeeeemmmm____sssswwwwaaaapppp, sssshhhhmmmmeeeemmmm____iiiinnnntttt4444____sssswwwwaaaapppp, sssshhhhmmmmeeeemmmm____iiiinnnntttt8888____sssswwwwaaaapppp, sssshhhhmmmmeeeemmmm____rrrreeeeaaaallll4444____sssswwwwaaaapppp,
  8.      sssshhhhmmmmeeeemmmm____rrrreeeeaaaallll8888____sssswwwwaaaapppp, sssshhhhmmmmeeeemmmm____lllloooonnnngggglllloooonnnngggg____sssswwwwaaaapppp - Performs an atomic swap to a
  9.      remote data object
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      C or C++:
  13.  
  14.         ####iiiinnnncccclllluuuuddddeeee <<<<mmmmpppppppp////sssshhhhmmmmeeeemmmm....hhhh>>>>
  15.  
  16.         ddddoooouuuubbbblllleeee sssshhhhmmmmeeeemmmm____ddddoooouuuubbbblllleeee____sssswwwwaaaapppp((((ddddoooouuuubbbblllleeee ****_t_a_r_g_e_t,,,, ddddoooouuuubbbblllleeee _v_a_l_u_e,,,, iiiinnnntttt _p_e))));;;;
  17.  
  18.         ffffllllooooaaaatttt sssshhhhmmmmeeeemmmm____ffffllllooooaaaatttt____sssswwwwaaaapppp((((ffffllllooooaaaatttt ****_t_a_r_g_e_t,,,, ffffllllooooaaaatttt _v_a_l_u_e,,,, iiiinnnntttt _p_e))));;;;
  19.  
  20.         iiiinnnntttt sssshhhhmmmmeeeemmmm____iiiinnnntttt____sssswwwwaaaapppp((((iiiinnnntttt ****_t_a_r_g_e_t,,,, iiiinnnntttt _v_a_l_u_e,,,, iiiinnnntttt _p_e))));;;;
  21.  
  22.         lllloooonnnngggg sssshhhhmmmmeeeemmmm____lllloooonnnngggg____sssswwwwaaaapppp((((lllloooonnnngggg ****_t_a_r_g_e_t,,,, lllloooonnnngggg _v_a_l_u_e,,,, iiiinnnntttt _p_e))));;;;
  23.  
  24.         lllloooonnnngggg lllloooonnnngggg sssshhhhmmmmeeeemmmm____lllloooonnnngggglllloooonnnngggg____sssswwwwaaaapppp((((lllloooonnnngggg lllloooonnnngggg ****_t_a_r_g_e_t,,,, lllloooonnnngggg lllloooonnnngggg _v_a_l_u_e,,,,
  25.         iiiinnnntttt _p_e))));;;;
  26.  
  27.         lllloooonnnngggg sssshhhhmmmmeeeemmmm____sssswwwwaaaapppp((((lllloooonnnngggg ****_t_a_r_g_e_t,,,, lllloooonnnngggg _v_a_l_u_e,,,, iiiinnnntttt _p_e))));;;;
  28.  
  29.      Fortran:
  30.  
  31.         IIIINNNNTTTTEEEEGGGGEEEERRRR _p_e
  32.  
  33.         IIIINNNNTTTTEEEEGGGGEEEERRRR SSSSHHHHMMMMEEEEMMMM____SSSSWWWWAAAAPPPP
  34.         _i_r_e_s = SSSSHHHHMMMMEEEEMMMM____SSSSWWWWAAAAPPPP((((_t_a_r_g_e_t,,,, _v_a_l_u_e,,,, _p_e))))
  35.  
  36.         IIIINNNNTTTTEEEEGGGGEEEERRRR((((KKKKIIIINNNNDDDD====4444)))) SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT4444____SSSSWWWWAAAAPPPP
  37.         _i_r_e_s = SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT4444____SSSSWWWWAAAAPPPP((((_t_a_r_g_e_t,,,, _v_a_l_u_e,,,, _p_e))))
  38.  
  39.         IIIINNNNTTTTEEEEGGGGEEEERRRR((((KKKKIIIINNNNDDDD====8888)))) SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT8888____SSSSWWWWAAAAPPPP
  40.         _i_r_e_s = SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT8888____SSSSWWWWAAAAPPPP((((_t_a_r_g_e_t,,,, _v_a_l_u_e,,,, _p_e))))
  41.  
  42.         RRRREEEEAAAALLLL((((KKKKIIIINNNNDDDD====4444)))) SSSSHHHHMMMMEEEEMMMM____RRRREEEEAAAALLLL4444____SSSSWWWWAAAAPPPP
  43.         _r_e_s = SSSSHHHHMMMMEEEEMMMM____RRRREEEEAAAALLLL4444____SSSSWWWWAAAAPPPP((((_t_a_r_g_e_t,,,, _v_a_l_u_e,,,, _p_e))))
  44.  
  45.         RRRREEEEAAAALLLL((((KKKKIIIINNNNDDDD====8888)))) SSSSHHHHMMMMEEEEMMMM____RRRREEEEAAAALLLL8888____SSSSWWWWAAAAPPPP
  46.         _r_e_s = SSSSHHHHMMMMEEEEMMMM____RRRREEEEAAAALLLL8888____SSSSWWWWAAAAPPPP((((_t_a_r_g_e_t,,,, _v_a_l_u_e,,,, _p_e))))
  47.  
  48. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  49.      sssshhhhmmmmeeeemmmm____sssswwwwaaaapppp performs an atomic swap operation. It writes value _v_a_l_u_e
  50.      into _t_a_r_g_e_t on processing element (PE) _p_e and returns the previous
  51.      contents of _t_a_r_g_e_t as an atomic operation.
  52.  
  53.      The arguments are as follows:
  54.  
  55.      _t_a_r_g_e_t    The remotely accessible integer data object to be updated on
  56.                the remote PE.  If you are using C/C++, the type of _t_a_r_g_e_t
  57.                should match that implied in the SYNOPSIS section.  If you
  58.                are using Fortran, it must be of the following type:
  59.  
  60.                     RRRRoooouuuuttttiiiinnnneeee                  DDDDaaaattttaaaa TTTTyyyyppppeeee
  61.  
  62.                     SSSSHHHHMMMMEEEEMMMM____SSSSWWWWAAAAPPPP               Integer of default kind
  63.  
  64.                     SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT4444____SSSSWWWWAAAAPPPP          4-byte integer
  65.  
  66.                     SSSSHHHHMMMMEEEEMMMM____IIIINNNNTTTT8888____SSSSWWWWAAAAPPPP          8-byte integer
  67.  
  68.                     SSSSHHHHMMMMEEEEMMMM____RRRREEEEAAAALLLL4444____SSSSWWWWAAAAPPPP         4-byte real
  69.  
  70.                     SSSSHHHHMMMMEEEEMMMM____RRRREEEEAAAALLLL8888____SSSSWWWWAAAAPPPP         8-byte real
  71.  
  72.      _v_a_l_u_e     Value to be atomically written to the remote PE.  _v_a_l_u_e is
  73.                the same type as _t_a_r_g_e_t.
  74.  
  75.      _p_e        An integer that indicates the PE number on which _t_a_r_g_e_t is
  76.                to be updated.  If you are using Fortran, it must be a
  77.                default integer value.
  78.  
  79. NNNNOOOOTTTTEEEESSSS
  80.      The term _r_e_m_o_t_e_l_y _a_c_c_e_s_s_i_b_l_e is defined in iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3).
  81.  
  82.      sssshhhhmmmmeeeemmmm____sssswwwwaaaapppp writes directly into another PE's memory without notifying
  83.      that PE, so the receiving PE should normally set automatic cache
  84.      invalidation by use of sssshhhhmmmmeeeemmmm____sssseeeetttt____ccccaaaacccchhhheeee____iiiinnnnvvvv(3) or
  85.      sssshhhhmmmmeeeemmmm____sssseeeetttt____ccccaaaacccchhhheeee____lllliiiinnnneeee____iiiinnnnvvvv(3).  If this is not done, the receiving PE's
  86.      data cache might become incoherent.
  87.  
  88.      You can use sssshhhhmmmmeeeemmmm____sssswwwwaaaapppp without setting the remote write invalidate bit
  89.      if you know, prior to the call, that the data at the target addresses
  90.      are not cachable or are otherwise known not to reside in the remote
  91.      processor's cache at the time of the call.  Alternatively, the
  92.      receiving processor can flush its cache when it knows that it has
  93.      received data from another processor.  In general, this requires
  94.      synchronization.  The cache can be flushed using sssshhhhmmmmeeeemmmm____uuuuddddccccfffflllluuuusssshhhh(((()))) or
  95.      sssshhhhmmmmeeeemmmm____uuuuddddccccfffflllluuuusssshhhh____lllliiiinnnneeee(((()))).
  96.  
  97. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
  98.      The contents that had been at the target address on the remote PE
  99.      prior to the swap is returned.
  100.  
  101. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  102.      iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3), sssshhhhmmmmeeeemmmm____cccclllleeeeaaaarrrr____ccccaaaacccchhhheeee____iiiinnnnvvvv(3), sssshhhhmmmmeeeemmmm____sssseeeetttt____ccccaaaacccchhhheeee____iiiinnnnvvvv(3),
  103.      sssshhhhmmmmeeeemmmm____sssseeeetttt____ccccaaaacccchhhheeee____lllliiiinnnneeee____iiiinnnnvvvv(3)
  104.